package org.eden.web.config;

import org.eden.rpc.core.client.pooled.DefaultRpcClientPool;
import org.eden.rpc.core.client.pooled.SimpleBlockingNettyConnectionPool;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NettyConfig {

    @Value("${host}")
    private String host;
    @Value("${port}")
    private int port;

//    @Bean
//    public SimpleBlockingNettyConnectionPool newNettyClientPool() {
//        return new SimpleBlockingNettyConnectionPool(host, port, 64);
//    }

    @Bean
    public DefaultRpcClientPool newServicePool() {
        return new DefaultRpcClientPool(host, port);
    }

}
